<!doctype html>
<html class="no-js">
<head>
<% include("/common/admin_head.html",{title: '添加/编辑日志', validatorJS: true, loadUE: true}){}%>
<script>
  $(document).ready( function() {
    $("#actionClassName").change( function() {
      var actionClassName = $("#actionClassName");
      var actionMethodName = $("#actionMethodName");
      $.post("${base}/logConfig/getAllActionMethod", {
        "logConfig.actionClassName" :actionClassName.val()
      }, function(data, textStatus) {
        if (data != "") {
        	actionMethodName.html(data);
        }
      });
    });
  });
</script>
<%var isAdd = false;
  var isEdit = false;
  if(isEmpty(logConfig.id)){
	isAdd = true;
  }else{
	isEdit = true;
  }%>
</head>
<body>
<!-- content start -->
<div class="admin-content">
  <div class="admin-content-body">
    <div class="am-cf app-padding-title">
      <div class="am-fl am-cf">
        <strong class="am-text-primary am-text-lg">系统管理</strong> / <small><%if(isAdd){%>添加需进行日志监控的方法<%}else{%>编辑需进行日志监控的方法<%}%></small>
      </div>
    </div>
  
    <hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-0" />
    
    <form class="validator-form" action="<%if (isAdd){%>${base}/logConfig/save<%}else{%>${base}/logConfig/update<%}%>" method="post">
    <input type="hidden" name="logConfig.id" value="${logConfig.id!}" />
    <div class="am-form am-margin am-form-horizontal">
      <div class="am-form-group am-form-group-sm">
        <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">名称</label>
        <div class="am-u-sm-8 am-u-md-9">
          <input type="text" class="am-form-field" name="logConfig.operationName" value="${logConfig.operationName!}" required />
        </div>
      </div>
      <div class="am-form-group am-form-group-sm">
        <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">Action类</label>
        <div class="am-u-sm-8 am-u-md-9">
          <select id="actionClassName" name="logConfig.actionClassName" data-am-selected="{btnWidth: '100%', maxHeight: '200px', btnSize: 'sm', btnStyle: 'secondary'}" required>
	        <option value=""></option>			
            <%for(list in allActionClassName){%>
		    <option value="${list}" <%if (list == logConfig.actionClassName!){%>selected="selected"<%}%>>
		      ${list}
		    </option>
			<%}%>
		  </select>
        </div>
      </div>
      <div class="am-form-group am-form-group-sm">
        <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">Action方法</label>
        <div class="am-u-sm-8 am-u-md-9">
          <select id="actionMethodName" name="logConfig.actionMethodName" data-am-selected="{btnWidth: '100%', maxHeight: '200px', btnSize: 'sm', btnStyle: 'secondary'}" required>
            <option value="${logConfig.actionMethodName!}" selected="selected">
              ${logConfig.actionMethodName!}
            </option>
          </select>
        </div>
      </div>
      <div class="am-form-group am-form-group-sm">
        <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">描述</label>
        <div class="am-u-sm-8 am-u-md-9">
          <textarea rows="10" class="am-form-field" name="logConfig.description">${logConfig.description!}</textarea>
        </div>
      </div>
      <hr data-am-widget="divider" class="am-divider am-divider-dashed" />
      <div class="am-form-group am-form-group-sm">
        <div class="am-u-sm-8 am-u-sm-offset-4 am-u-md-9 am-u-md-offset-3">
          <button type="submit" class="am-btn am-btn-primary"><span class="am-icon-save">  保  存</span></button>
          <button type="button" class="am-btn am-btn-default" onclick="window.history.back(); return false;"><span class="am-icon-undo">  返  回</span></button>
        </div>
      </div>
    </div>
    </form>
  </div>
</div>
<!-- content end -->
</body>
</html>